#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>

int main(int argc, char **argv)
{
	int fd;
	int value;
    unsigned char key_value;

	fd = open("/dev/button_driver", O_RDONLY);
	if(fd < 0)
	{
		perror("cannot open device button");
		exit(1);
	}

    while(1){
        read(fd, &key_value, sizeof(key_value));
        printf("zhe key_value is %d\n", key_value);
    }

	close(fd);
	return 0;

}
